package com.example.book.adapter;

/**
 * Created with IntelliJ IDEA.
 * Description: 适配器: 是一种补偿模式
 * 以该示例来说，先有了 Log4j，后有的Slf4j，为了适配Log4j，因此有了适配器
 * User: Li_yizYa
 * Date: 2025/7/20
 * Time: 21:46
 */
public class Slf4jLog4jAdapter implements Slf4jApi {

    private Log4jApi log4jApi;

    public Slf4jLog4jAdapter(Log4jApi log4jApi) {
        this.log4jApi = log4jApi;
    }

    @Override
    public void log(String log) {
        log4jApi.print(log);

    }
}
